package com.liuh.web;

import com.jfinal.core.Controller;

public class LoginC extends Controller {

	public void index() {
		Object user = getSessionAttr("loginUser");
		if (user != null) {
			render("/views/main.html");
		} else {
			render("/login/login.html");
		}
	}
	
	public void test(){
		AuthUserM authUse =new AuthUserM();
		authUse.setAi_username("au-1016");
		authUse.setUsername("liuh");
		authUse.setType(0);
		setSessionAttr("loginUser", authUse);
		setSessionAttr("staffId", authUse.getAi_username());
		setSessionAttr("userName", authUse.getUsername());
		
		render("/views/main.html");
	}
}